#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<string.h>
#include<unistd.h>

int main(){
  const char* arr1="i like linux";
  char buffer[128];
  int fd=open("bire",O_WRONLY|O_CREAT|O_TRUNC,0666);
  if(fd==-1){
    perror("open failed\n");
    return 1;
  }
  int writebytes=write(fd,arr1,strlen(arr1));
  close(fd);
  fd=open("bite",O_RDONLY);
  int readbytes=read(fd,buffer,sizeof(buffer)-1);
  buffer[readbytes]='\0';
  close(fd);
  return 0;
}
